<%@page import="factory.DaoFactory"%>
<%@page import="bean.Exam"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>考后操作</title>
</head>
<body>
	<%@include file="teacher_head.jsp"%>
	<div class="container">
		<div class="row">
			<div class="form-inline">
				<img src="../../resource/teacher.jpg" class="img-rounded imgstyle" />
				<h1>
					<strong>上机考试管理</strong>
				</h1>
			</div>
		</div>
	</div>
	<br>
	<div class="container">
		<h2>
			<strong>查找结果</strong>
		</h2>
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<td>考试名称</td>
					<td>考试时间</td>
					<td>创建人</td>
					<td>上传试卷</td>
					<td>自动开始</td>
					<td>进行中</td>
					<td>已结束</td>
					<td>已归档</td>
					<td>已清理</td>
					<td>结束考试</td>
					<td>下载答案</td>
					<td>清理考试</td>
				</tr>
			</thead>
			<tbody>
				<%
					List<Exam> list = DaoFactory.getExamDaoInstance().queryexam();
					for (Exam exam : list) {
				%>
				<tr>
					<td><%=exam.getExamname() != null ? exam.getExamname() : ""%></td>
					<td><%=exam.getStarttime() != null ? exam.getStarttime() : ""%></td>
					<td><%=exam.getExamcreator() != null ? exam.getExamcreator() : ""%></td>
					<td><%=exam.getExampaper() != null ? exam.getExampaper() : ""%></td>
					<td><%=exam.getAutostart() != null ? exam.getAutostart() : ""%></td>
					<td><%=exam.getExamining() != null ? "√" : ""%></td>
					<td><%=exam.getFinished() != null ? "√" : ""%></td>
					<td><%=exam.getArchived() != null ? "√" : ""%></td>
					<td><%=exam.getCleaned() != null ? "√" : ""%></td>
					<td><a onclick="return confirm('确认要结束考试吗?')"
						href="../../servlet_exitexam_teacher?examname=<%=exam.getExamname()%>&examcreator=<%=exam.getExamcreator()%>"
						class="btn btn-default btn-sm glyphicon glyphicon-ok"></a></td>
					<td><a style="display:<%=exam.getFinished() == null ? "none" : ""%>"
						href="../../servlet_downloadanswerpaper_teacher?examname=<%=exam.getExamname()%>&examcreator=<%=exam.getExamcreator()%>"
						class="btn btn-default btn-sm glyphicon glyphicon-download"></a></td>
					<td><a onclick="return confirm('确认要删除考试记录吗?')"
						style="display:<%=exam.getArchived() == null ? "none" : ""%>"
						href="../../servlet_deleteexam_teacher?examid=<%=exam.getExamid()%>"
						class="btn btn-default btn-sm glyphicon glyphicon-remove"></a></td>
				</tr>
				<%
					}
				%>
			</tbody>
		</table>
	</div>

</body>
</html>